<?php
	session_start();
?>

<script>
	function envia(obj){

		opcao = obj.name;
		form = document.formulario;

		if(opcao == "insereSubCategoria"){
			form.action="insereSubCategoriaB.php"
		}
		else if(opcao == "insereDepoimento"){
			form.action="insereDepoimento.php"
		}

		form.method = "POST";
		form.submit();

	}
</script>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Experi&ecirc;ncias do Processo de Adoecimento</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="vivencias.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="f4f1fc">
<div align="center">
  <table width="630" border="0">
    <tr bgcolor="#FFFFFF">
      <td width="109" align="center" valign="top"><img src="imagens/logo.jpg" width="66" height="53"></td>
      <td width="481" align="center" valign="top"><img src="imagens/tit1.jpg" width="612" height="28"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td colspan="2" align="center" valign="top"><table width="95%" border="0" cellpadding="5" cellspacing="1">
          <tr align="left" valign="middle">
            <td colspan="3" class="miudo">Voltar</td>
          </tr>
          <tr>
            <td colspan="3" class="ativo"><strong>Formul&aacute;rio para depoimentos</strong></td>
          </tr>

        <!--<form name="insereDepoimento" enctype="multipart/form-data" action="insereDepoimento.php" method="post">-->
        <form name="formulario" enctype="multipart/form-data">
          <tr bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="titvermelho"><strong><a name="depoimento"></a>Inserir
              Novo Depoimento</strong></td>
            <td colspan="2" align="left" valign="middle" class="miudo"> <input type="file" name="depoimento" value="Procurar arquivo">
           </td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Classifica&ccedil;&atilde;o</strong></td>
            <td colspan="2" valign="middle" class="texto2"> <select name="tipoDepoimento">
                <option value="0">V&iacute;deo</option>
                <option value="2">Texto</option>
                <option value="1">&Aacute;udio</option>
                <option value="3">Foto</option>
              </select></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Subcategoria</strong></td>
            <td colspan="2" align="left" valign="middle" class="texto2"><select name="subCategoria">

            <!-- Lista as subCategorias daquela categoria-->
            <?php
			include("/var/www/html/vivencias/conexaoBD.php");

			//pegando a idCategoria da categoria mãe da subcategoria
			$idCategoria = $_SESSION['idCategoria'];
			$query = "SELECT * FROM subCategBancoExp where idCategoria=$idCategoria";
			$resultado = mysql_query($query,$conexao);
			while($objeto = mysql_fetch_object($resultado)){
            ?>
                <option value="<?php echo $objeto->idSubCategoria; ?>"><?php echo $objeto->nome;} ?></option>
		<input type="hidden" name="idCategoria" value=<?echo $idCategoria;?>>
              </select>

             <!-- <form name="insereSubCategoria" enctype="multipart/form-data" action="insereSubCategoriaB.php" method="post">-->
              	<span class="miudo">Criar nova subcategoria:</span> <input name="nomeSubCategoria" type="text" size="15">
              	<input type="hidden" name="idCategoria" value=<?echo $idCategoria;?>>
              	<input type="hidden" name="lugarCadastro" value="1"><!--cadastro de uma subcategoria dentro do form de inserir depoimento-->
              	<!--<input type="submit" name="Submit" value="Ok"> -->
		<input type="button" name="insereSubCategoria" id="insereSubCategoria" value="Ok" onclick="envia(this)";></td>
              <!--</form>-->

          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"> <strong>Idade no
              depoimento</strong> <div align="left"></div></td>
            <td colspan="2" align="left" valign="middle" class="texto2"> <input name="idadeDepoimento" type="text" size="40"></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Idade no
              diagnostico</strong></td>
            <td colspan="2" align="left" valign="middle" class="texto2"> <input name="idadeDiagnostico" type="text" size="40"></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Sexo</strong></td>
            <td colspan="2" align="left" valign="middle" class="texto2"> <input type="radio" name="sexo" value="feminino">
              Feminino
              <input type="radio" name="sexo" value="masculino">
              Masculino</td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Coment&aacute;rio</strong></td>
            <td colspan="2" align="left" valign="middle" class="texto2"><strong>
              <textarea name="comentario" cols="40" rows="3"></textarea>
              </strong></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>T&iacute;tulo</strong></td>
            <td colspan="2" align="left" valign="middle" class="texto2"><strong>
              <textarea name="frase" cols="40" rows="3"></textarea>
              </strong> </td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Respons&aacute;vel</strong></td>
            <td colspan="2" align="left" valign="middle" class="texto2"> <select name="responsavel">
                <option value="1">Al&iacute;cia Navarro</option>
                <option value="2">Erotildes Leal</option>
                <option value="3">Nelson Goldenstein</option>
                <option value="4">Ot&aacute;vio Domont</option>
              </select> <span class="miudo"><br>
              Obs. Somente o respons&aacute;vel pelo v&iacute;deo poder&aacute;
              fazer altera&ccedil;&otilde;es no mesmo.</span></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Permiss&otilde;es</strong></td>
            <td colspan="2" align="left" valign="middle" class="texto2"> <input type="checkbox" name="professor" value="4">
              Professores<br> <input type="checkbox" name="aluno" value="2">
              Alunos<br> <input type="checkbox" name="tutor" value="1">
              Tutores<br> <input type="checkbox" name="paciente" value="5">
              Pacientes<br> <input type="checkbox" name="visitante" value="3">
              Visitantes </td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td colspan="3" class="titvermelho"><strong>Ficha T&eacute;cnica</strong></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Permiss&atilde;o
              do paciente</strong></td>
            <td colspan="2" valign="middle" class="texto2"><input type="file" name="permissao" value="Procurar arquivo">
            </td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Local da
              grava&ccedil;&atilde;o</strong></td>
            <td colspan="2" valign="middle" class="texto2"><input name="localGravacao" type="text" size="40"></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Data da grava&ccedil;&atilde;o</strong></td>
            <td colspan="2" valign="middle" class="texto2"><input name="dataGravacao" type="text" size="40"></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Dire&ccedil;&atilde;o</strong></td>
            <td colspan="2" valign="middle" class="texto2"><input name="direcao" type="text" size="40"></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>C&acirc;mera</strong></td>
            <td colspan="2" valign="middle" class="texto2"><input name="camera" type="text" size="40"></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Entrevistador</strong></td>
            <td colspan="2" valign="middle" class="texto2"><input name="entrevistador" type="text" size="40"></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Tamanho deste
              arquivo</strong></td>
            <td colspan="2" valign="middle" class="texto2"><input name="tamArquivo" type="text" size="40"></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Tamanho do
              arquivo original </strong></td>
            <td colspan="2" valign="middle" class="texto2"><input name="tamArquivoOriginal" type="text" size="40"></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2"><strong>Autoria</strong></td>
            <td colspan="2" valign="middle" class="texto2"><input name="autoria" type="text" size="40"></td>
          </tr>
          <tr align="left" bgcolor="ddd9e9" class="texto">
            <td align="right" valign="middle" class="texto2">&nbsp;</td>
            <td colspan="2" valign="middle" class="texto2"><strong>
         <input type="button" name="insereDepoimento" id="insereDepoimento" value="envia" onclick="envia(this)";>
              </strong></td>
          </tr>
          </form>
        </table></td>
    </tr>
  </table>
</div>
</body>
</html>
